package personal.gavin.utils
{	
	import mx.utils.ColorUtil;
	
	public class ColorUtil
	{		
		public static function adjustBrightnessS(rgb:String, brite:Number):String {
			var cuint:uint = ColorUtil.colorStringToInt(rgb);
			return ColorUtil.colorIntToString(mx.utils.ColorUtil.adjustBrightness(cuint,brite));
		}
		
		public static function adjustBrightness2S(rgb:String, brite:Number):String {
			var cuint:uint = ColorUtil.colorStringToInt(rgb);
			return ColorUtil.colorIntToString(mx.utils.ColorUtil.adjustBrightness2(cuint,brite));
		}
		
		public static function colorIntToString(color_int:uint = 0):String {
            var mask:String = "000000";
            var str:String = mask + color_int.toString(16).toUpperCase();
            return "#" + str.substr(str.length - 6);
        }
        
        public static function colorStringToInt(color_str:String = "#000000"):int {
            var mask:uint = 0;
            var num_str:String = "0x" + color_str.substr(color_str.length - 6);
            var colint:uint = mask + parseInt(num_str);
            return colint;
        }
	}
}